#ifndef _KRLTHREAD_H_
#define _KRLTHREAD_H_

#include "krlthread_t.h"

void krl_thdkrlstk_init (thread_t * thdp, void * thdfunc, reg_t cpsr, reg_t spsr);

uint_t krl_return_thdid (thread_t * thdp);
thread_t * krl_create_thddsc (void);
thread_t * krl_create_thread (void * thdfunc, uint_t flag, uint_t privalege,
                              uint_t priority, size_t usrstksz, size_t krlstksz);

void krl_inc_thdtick (thread_t * thdp);

hand_t krl_thd_add_objnode (thread_t * thdp, objnode_t * objndp);
hand_t krl_thd_delete_objnode (thread_t * thdp, hand_t hand);
objnode_t * krl_thd_return_objnode (thread_t * thdp, hand_t handidx);

#endif
